<?php

namespace App\Cache;

class RedisKey
{
    /**
     * 免费聊天数量
     * @param $userId
     * @return string
     */
    public static function getUserMsgNum($userId){
        return 'free:Private:chat:userId:'.$userId;
    }

    // +--------------------------------------------------------------------------------------------------------------------------------------------
    // | 搭讪
    // +--------------------------------------------------------------------------------------------------------------------------------------------
    /**
     * 用户搭讪的key
     * @param $userId
     * @return string
     */
    public static function userRecommendKey($userId): string
    {
        return 'user:recommend:userId:' . $userId;
    }

    /**
     * 获取推荐的新人
     * @param $role
     * @param $gender
     * @param $online
     * @return string
     */
    public static function userRecommendNewUserKey($role, $gender, $online): string
    {
        return 'user:recommend:new:role:' . $role . ':gender:' . $gender . ':online:' . $online;
    }

    /**
     * 锁定用户推荐的功能
     * @param $userId
     * @return string
     */
    public static function userRecommendLock($userId): string
    {
        return 'user:recommend:lock:userId:' . $userId;
    }

    /**
     * 周期内的用户数量
     * @param $userId
     * @return string
     */
    public static function userRecommendNum($userId): string
    {
        return 'user:recommend:num:userId:' . $userId;
    }

    // +--------------------------------------------------------------------------------------------------------------------------------------------
    // | 通话
    // +--------------------------------------------------------------------------------------------------------------------------------------------
    /**
     * 操作视频通话的锁
     * @param $recordId
     * @return string
     */
    public static function operateVideoCallLock($recordId): string
    {
        return 'call:video:recordId:' . $recordId;
    }

    /**
     * 操作语音通话的锁
     * @param $recordId
     * @return string
     */
    public static function operateVoiceCallLock($recordId): string
    {
        return 'call:voice:recordId:' . $recordId;
    }

    /**
     * 操作付款逻辑的锁
     * @param $recordId
     * @param $type
     * @return string
     */
    public static function operatePaymentLock($recordId, $type): string
    {
        return 'call:payment:recordId:' . $recordId . ':callType:' . $type;
    }

    // +--------------------------------------------------------------------------------------------------------------------------------------------
    // | 提现
    // +--------------------------------------------------------------------------------------------------------------------------------------------

    /**
     * 用户操作提醒申请的锁
     * @param $userId
     * @return string
     */
    public static function operationApplyLock($userId): string
    {
        return 'guild:withdrawal:apply:userId:' . $userId;
    }

    /**
     * 主播操作提现申请的锁
     * @param $userId
     * @return string
     */
    public static function operationHostApplyLock($userId): string
    {
        return 'host:withdrawal:apply:userId:' . $userId;
    }

    /**
     * 用户每日修改昵称次数限制的锁
     * @param $userId
     * @return string
     */
    public static function operationUserProfileByNicknameLock($userId): string
    {
        return 'user:profile:update:nickname:userId:' . $userId;
    }

    /**
     * 用户每日修改恋爱宣言次数限制的锁
     * @param $userId
     * @return string
     */
    public static function operationUserProfileByIntroLock($userId): string
    {
        return 'user:profile:update:intro:userId:' . $userId;
    }

    // +--------------------------------------------------------------------------------------------------------------------------------------------
    // | 发消息
    // +--------------------------------------------------------------------------------------------------------------------------------------------
    public static function getMessageConsume(): string
    {
        return 'user:message:consume:list';
    }

    // +--------------------------------------------------------------------------------------------------------------------------------------------
    // | 视频邀约
    // +--------------------------------------------------------------------------------------------------------------------------------------------

    /**
     * 参加今日邀约的
     * @return string
     */
    public static function joinInviteVideoToday(): string
    {
        return 'invite:video:join:list';
    }

    /**
     * 今日视频邀约列表
     * @param $userId
     * @return string
     */
    public static function todayInviteVideoList($userId): string
    {
        return 'invite:video:list:day:'.date('Ymd').':userId:'.$userId;
    }

    /**
     * 女用户锁定
     * @return string
     */
    public static function inviteVideoFemaleLock(): string
    {
        return 'invite:video:lock:female';
    }

    /**
     * 男用户锁定
     * @return string
     */
    public static function inviteVideoMaleLock(): string
    {
        return 'invite:video:lock:male';
    }

    /**
     * 今日参加过的男女配对锁
     * @return string
     */
    public static function todayJoinLock(): string
    {
        return 'invite:video:lock';
    }

    /**
     * 渠道屏蔽的用户集合
     * @return string
     */
    public static function appHiddenUser(): string
    {
        return 'app:hidden:user';
    }

    /**
     * 新人女用户提示框，位表示，需要转换为二进制，0未提示 1已提示
     * @param $userId
     * @return string
     */
    public static function newGirlPopStatus($userId): string
    {
        return 'newGirl:pop:status:'.$userId;
    }

    // +--------------------------------------------------------------------------------------------------------------------------------------------
    // | 推荐分
    // +--------------------------------------------------------------------------------------------------------------------------------------------
    public static function todayUserGradeList($grade): string
    {
        return 'user:list:grade:'.$grade;
    }
}
